home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / BlondesBrunettes.dxr / Internal_66_tableau cards.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  2.9 KB  |  86 lines

  1. property myrow
  2. global tableau, stock, equal, hotcard, waste, foundation, points, spcount, scount, tcount
  3.  
  4. on beginSprite me
  5.   if tcount = 0 then
  6.     tcount = tcount + 1
  7.   end if
  8.   scount = scount + 1
  9.   myrow = tcount
  10.   if scount = 1 then
  11.     sprite(me.spriteNum).visible = 1
  12.     sprite(me.spriteNum).member = stock.cards[1].rank & "_" & stock.cards[1].suit
  13.     stock.cards.deleteAt(1)
  14.     tableau.addProp(makesymbol(myrow), new(script("foundation object"), []))
  15.     tableau[makesymbol(myrow)].addCard(new(script("card"), me.spriteNum))
  16.   else
  17.     sprite(me.spriteNum).visible = 0
  18.   end if
  19.   if scount = 11 then
  20.     scount = 0
  21.     tcount = tcount + 1
  22.   end if
  23. end
  24.  
  25. on mouseDown me
  26.   if sprite(me.spriteNum).visible = 1 then
  27.     if me.spriteNum = tableau[makesymbol(myrow)].getlastcard().spnum then
  28.       puppetSound(3, "pickcard")
  29.       sprite(me.spriteNum).moveableSprite = 1
  30.       sprite(me.spriteNum).locZ = me.spriteNum + 1000
  31.       sprite(me.spriteNum).loc = the mouseLoc
  32.     end if
  33.   end if
  34. end
  35.  
  36. on mouseUp me
  37.   if sprite(me.spriteNum).moveableSprite = 1 then
  38.     if (equal = 1) and (hotcard <> 0) then
  39.       puppetSound(3, "pickcard")
  40.       sprite(me.spriteNum).moveableSprite = 0
  41.       sprite(me.spriteNum).visible = 0
  42.       sprite(me.spriteNum).loc = tableau[makesymbol(myrow)].getlastcard().location
  43.       sprite(me.spriteNum).locZ = me.spriteNum
  44.       sprite(hotcard).member = sprite(the clickOn).member
  45.       sprite(hotcard).visible = 1
  46.       if (hotcard >= 28) and (hotcard <= 35) then
  47.         foundation[makesymbol(hotcard)].addCard(new(script("card"), hotcard))
  48.         points = points + 15
  49.       end if
  50.       if (hotcard >= 56) and (hotcard <= 143) then
  51.         tableau[makesymbol(sprite(hotcard).myrow)].addCard(new(script("card"), hotcard))
  52.       end if
  53.       tableau[makesymbol(myrow)].cards.deleteOne(tableau[makesymbol(myrow)].getlastcard())
  54.       if tableau[makesymbol(myrow)].cards.count > 0 then
  55.         nothing()
  56.       else
  57.         sprite(me.spriteNum).visible = 1
  58.         if waste.count > 0 then
  59.           sprite(me.spriteNum).member = waste[waste.count].membername
  60.           waste.deleteAt(waste.count)
  61.           tableau[makesymbol(myrow)].addCard(new(script("card"), me.spriteNum))
  62.           if waste.count > 0 then
  63.             sprite(37).member = waste[waste.count].membername
  64.           else
  65.             sprite(37).visible = 0
  66.           end if
  67.         else
  68.           if stock.cards.count > 0 then
  69.             sprite(me.spriteNum).member = stock.cards[1].rank & "_" & stock.cards[1].suit
  70.             stock.cards.deleteAt(1)
  71.             tableau[makesymbol(myrow)].addCard(new(script("card"), me.spriteNum))
  72.           else
  73.             sprite(me.spriteNum).member = "block"
  74.           end if
  75.         end if
  76.       end if
  77.     else
  78.       puppetSound(3, "dropcard")
  79.       sprite(me.spriteNum).moveableSprite = 0
  80.       sprite(me.spriteNum).loc = tableau[makesymbol(myrow)].getlastcard().location
  81.       sprite(me.spriteNum).locZ = me.spriteNum
  82.     end if
  83.   end if
  84.   checklose()
  85. end
  86.